<?php

namespace api\components;

use yii\base\Component;
use common\services\cache\CommonCache;



class User extends Component{

    // 注入获取用户信息
    public function getInfo() {
        $headers = \Yii::$app->getRequest()->getHeaders();
        $token = $headers->get('token');
        return CommonCache::getCache($token);
    }
}